package com.yunxi.service.localService.impl.sto;

import com.yunxi.core.service.ServiceImplPlus;
import com.yunxi.core.util.BeanTools;
import com.yunxi.dao.sto.VehiclePdiBillMapper;
import com.yunxi.model.sto.VehiclePdiBill;
import com.yunxi.service.localService.sto.VehiclePdiBillService;
import com.yunxi.sto.pojo.StoDriverVO;
import com.yunxi.sto.pojo.VehiclePdiBillListVO;
import com.yunxi.sto.pojo.VehiclePdiBillVO;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 车辆pdi订单 服务实现类
 * </p>
 *
 * @author caoYong
 * @since 2019-08-14
 */
@Service
public class VehiclePdiBillServiceImpl extends ServiceImplPlus<VehiclePdiBillMapper, VehiclePdiBill> implements VehiclePdiBillService {

    @Override
    public List<VehiclePdiBillVO> queryList(VehiclePdiBillVO vehiclePdiBillVO) throws Exception {
        Map map = BeanTools.bean2map(vehiclePdiBillVO);
        return baseMapper.queryByList(map);
    }

    @Override
    public List<VehiclePdiBillVO> export(VehiclePdiBillVO vehiclePdiBillVO) throws Exception {
        Map map = BeanTools.bean2map(vehiclePdiBillVO);
        return baseMapper.queryByList(map);
    }

    /**
     * 查询PDI检查项
     * @return
     */
    @Override
    public List<String> queryPdiItem() {
        return baseMapper.queryPdiItem();
    }

    /**
     * 获取详情
     * @param pdiBillId
     * @return
     * @throws Exception
     */
    @Override
    public VehiclePdiBillVO getDetail(String pdiBillId) throws Exception {
        return baseMapper.getDetail(pdiBillId);
    }

    /**
     * 获取PDI检查项
     * @return
     */
    @Override
    public List<VehiclePdiBillListVO> pdiList() {
        return baseMapper.pdiList();
    }

    /**
     * 查询今日上班司机
     * @param stoDriverVO
     * @return
     */
    @Override
    public List<StoDriverVO> queryTodayDriver(StoDriverVO stoDriverVO) {
        return baseMapper.queryTodayDriver(stoDriverVO);
    }

    /**
     * 通过VIN查询产品名称
     * @param vin
     * @return
     */
    @Override
    public String getProductNameByVin(String vin) {
        return baseMapper.getProductNameByVin(vin);
    }
}
